<script type="text/javascript" src="../Public/js/jquery.ajaxupload.js?1002"></script>

<title>切换个性头像</title>

<script type="text/javascript">
	$(document).ready(function(){
	    new AjaxUpload('#uploadHead', {
	        action: APP+'/Member/uploadHead/id/{$id}',
	        name: 'picfile',
	        onSubmit : function(file , ext){
	            
	            if (ext && /^(jpg|png|jpeg|gif)$/.test(ext)){
	                /* Setting data */
	                this.setData({
	                'ext': ext
	                });
	                this.disable();
	            } else {
	                return false;
	            }
	
	        },
	        onComplete : function(file,response){
	            var str = response.match(/^\"(.*?)\"/gi);
			     var data = eval("(" + str + ")");
			     
			     if(data != null){
					 var headpath = "__PUBLIC__/images/head/b/";
					 $('#showicon').attr('src',headpath+data);
					 $('#photo').val(data);
					 this.enable();
		            removeDialogbox("#usericon");
			     }else{
				     nbalert('上传失败','提示');
			    	 this.enable();
				 }      
	        }
	    });
	
	
	});
</script>
	
	
<div id="memberIcon" class="clearfix">
	<iterate name="headdata" id="v">
		<span class="iconList">
			<a href="javascript:void(0)"; onclick="selsectlogo('__PUBLIC__/images/head/b/{$v.filename}','{$v.filename}');">
				<img src="__PUBLIC__/images/head/s/{$v.filename}" title="点击选中图像" >
			</a>
		</span>
	</iterate>
	<div style="clear:both; display:block; overflow:hidden; height:0px;"></div>
	<div>
		<div id="newIconList" class="fl">
			<span class="button">
				<span class="first-child">
					<button type="button">换一组头像</button>
				</span>
			</span>
		</div>
		<notempty name="info">
			<div id="uploadHead" class="fl">
				<span class="button">
					<span class="first-child">
						<button type="button">上传头像</button>
					</span>
				</span>
			</div>
		</notempty>
	</div>

</div>